package com.xiweicheng.test.jpa.entity;
// Generated 2018-7-13 22:08:49 by Hibernate Tools 5.0.6.Final

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

/**
 * File generated by hbm2java
 */
@Entity
@Table(name = "file", catalog = "tms")
public class File implements java.io.Serializable {

	private Long id;
	private long version;
	private Date createDate;
	private String name;
	private String path;
	private String status;
	private String toId;
	private String toType;
	private String type;
	private String username;
	private String uuidName;
	private Set<Translate> translates = new HashSet<Translate>(0);

	public File() {
	}

	public File(String name, String path, String status, String username, String uuidName) {
		this.name = name;
		this.path = path;
		this.status = status;
		this.username = username;
		this.uuidName = uuidName;
	}

	public File(Date createDate, String name, String path, String status, String toId, String toType, String type,
			String username, String uuidName, Set<Translate> translates) {
		this.createDate = createDate;
		this.name = name;
		this.path = path;
		this.status = status;
		this.toId = toId;
		this.toType = toType;
		this.type = type;
		this.username = username;
		this.uuidName = uuidName;
		this.translates = translates;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Version
	@Column(name = "version", nullable = false)
	public long getVersion() {
		return this.version;
	}

	public void setVersion(long version) {
		this.version = version;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_date", length = 19)
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Column(name = "name", nullable = false)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "path", nullable = false)
	public String getPath() {
		return this.path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	@Column(name = "status", nullable = false)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name = "to_id")
	public String getToId() {
		return this.toId;
	}

	public void setToId(String toId) {
		this.toId = toId;
	}

	@Column(name = "to_type")
	public String getToType() {
		return this.toType;
	}

	public void setToType(String toType) {
		this.toType = toType;
	}

	@Column(name = "type")
	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Column(name = "username", nullable = false)
	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(name = "uuid_name", nullable = false)
	public String getUuidName() {
		return this.uuidName;
	}

	public void setUuidName(String uuidName) {
		this.uuidName = uuidName;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "file_translate", catalog = "tms", joinColumns = {
			@JoinColumn(name = "file_id", nullable = false, updatable = false) }, inverseJoinColumns = {
					@JoinColumn(name = "translate_id", nullable = false, updatable = false) })
	public Set<Translate> getTranslates() {
		return this.translates;
	}

	public void setTranslates(Set<Translate> translates) {
		this.translates = translates;
	}

}
